package com.simon.hse.view;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.TextView;

@SuppressLint("AppCompatCustomView")
public class RotateTextView extends TextView {


    public RotateTextView(Context context) {
        super(context);
    }

    public RotateTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        //倾斜度45,上下左右居中
        // canvas.rotate(45, getMeasuredWidth() / 3, getMeasuredHeight() / 3);
         canvas.rotate(45, getMeasuredWidth()*0.75f , getMeasuredHeight()*0.55f );
        super.onDraw(canvas);
    }

}